{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>上级分类：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <div class="select-box">
                    <select name="pid" class="select" datatype="*" nullmsg="请选择分类">
                        <option value="0">顶级分类</option>
                        {:widget('Ui/selectDb', ['foot',  ['id'=>['neq', $vo.id??'0']], ['flat'=>true,'pad_name'=>'name']], $vo.id ?? '')}
                    </select>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="名称" name="name" value="{$vo.name ?? ''}"  datatype="*" nullmsg="请填写名称">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>链接：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="链接" name="icon" value="{$vo.icon ?? ''}"  datatype="*" nullmsg="请填写名称">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <!--<div class="row cl">-->
            <!--<label class="form-label col-xs-3 col-sm-3">是否顶部导航：</label>-->
            <!--<div class="formControls col-xs-6 col-sm-6 skin-minimal">-->
                <!--<div class="radio-box">-->
                    <!--<input type="radio" name="is_nav" id="is_nav-0" value="0">-->
                    <!--<label for="is_nav-0">不是</label>-->
                <!--</div>-->
                <!--<div class="radio-box">-->
                    <!--<input type="radio" name="is_nav" id="is_nav-1" value="1">-->
                    <!--<label for="is_nav-1">是</label>-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="col-xs-3 col-sm-3"></div>-->
        <!--</div>-->
        <!--<div class="row cl">-->
            <!--<label class="form-label col-xs-3 col-sm-3">是否显示在手机端首页：</label>-->
            <!--<div class="formControls col-xs-6 col-sm-6 skin-minimal">-->
                <!--<div class="radio-box">-->
                    <!--<input type="radio" name="is_wap_index" id="is_wap_index-0" value="0">-->
                    <!--<label for="is_wap_index-0">不显示</label>-->
                <!--</div>-->
                <!--<div class="radio-box">-->
                    <!--<input type="radio" name="is_wap_index" id="is_wap_index-1" value="1">-->
                    <!--<label for="is_wap_index-1">显示</label>-->
                <!--</div>-->
            <!--</div>-->
            <!--<div class="col-xs-3 col-sm-3"></div>-->
        <!--</div>-->
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">排序：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="number" class="input-text" placeholder="排序" name="sort" value="{$vo.sort ?? '50'}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">状态：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="radio-box">
                    <input type="radio" name="status" id="status-1" value="1">
                    <label for="status-1">启用</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="status" id="status-0" value="0">
                    <label for="status-0">禁用</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("[name='is_nav'][value='{$vo.is_nav ?? '0'}']").prop("checked", true);
        $("[name='is_wap_index'][value='{$vo.is_wap_index ?? '0'}']").prop("checked", true);
        $("[name='status'][value='{$vo.status ?? '1'}']").prop("checked", true);
        $("[name='pid']").find("[value='{$vo.pid ?? ''}']").attr("selected", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
